
import java.util.Scanner;
 
/*
 * 反转部分单向链表
 */
class Node {
    int val;
    Node next;
    public Node(int val) {//构造方法
        super();
        this.val = val;
        this.next = null;
    }
}
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int len = sc.nextInt();
        int []value = new int[len];
 
        for (int i = 0; i < len; i++) {
            value[i] = sc.nextInt();
        }
 
        int left = sc.nextInt();
        int right = sc.nextInt();
 
        reverse( value, left-1, right-1);
        Node head = arrayToList(value);
        Node node;
        for (node = head; node.next != null; node = node.next) {
            System.out.print(node.val + " ");
        }
        System.out.print(node.val);
    }
    public static void reverse(int []value, int left, int right) {
        while (left < right) {
            int tmp = value[left];
            value[left] = value[right];
            value[right] = tmp;
            left++;
            right--;
        }
    }
    public static Node arrayToList(int []value) {
        Node head = new Node(-1);
        Node node = head;
        for (int i = 0; i < value.length; i++) {
            Node newNode = new Node(value[i]);
            node.next = newNode;
            node = newNode;
        }
        return head.next;
    }
}
